home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
JCSM Shareware Collection 1993 November
/
JCSM Shareware Collection - 1993-11.iso
/
cl720
/
qbnws15j.lzh
/
INTRPT.ASM
< prev
next >
Wrap
Assembly Source File
|
1989-03-14
|
15KB
|
366 lines
TITLE INTERRUPT - BASCOM software interrupt calling routine
PAGE 56,132
;***
; INTERRUPT - BASCOM software interrupt calling routine
;
; Copyright <C> 1986, 1987 Microsoft Corporation
;
;Purpose:
; Allows a BASIC program to invoke an interrupt through a CALL statement.
;
; INTERRUPT allows BASIC to set AX,BX,CX,DX,BP,SI,DI, and the flags
; before the call. INTERRUPTX also allows DS and ES to be set.
; Both routines will return the values of the registers upon the
; completion of a successful call. If the interrupt could not
; be generated (due to a bad interrupt number or an illegal array)
; then the interrupt number will be set to -1 to indicate an error.
;
;******************************************************************************
;
;Note:
; The DOSSEG, .MODEL, .CODE, and .DATA? directives used in this program
; are part of the simplified segment system of MASM 5.0. If you have
; an earlier version of MASM, you must modify the source to define
; the segments required by Microsoft high-level languages. These
; segments are discussed in Appendix C of "Learning and Using QuickBASIC."
;
; Frame structure definition
ARG1 = 0AH ;pointer to first of three arguments
ARG2 = 08H ;pointer to second of three arguments
ARG3 = 06H ;pointer to third of three arguments
; Frame temp variables
UCODE_FLGS = -02H ;user code flag register value
UCODE_DS = -04H ;user code DS register value
REG_NUM = -06H ;number of regs used (INTERRUPT=8, INTERRUPTX=10)
INT_ES = -08H ;INT ES register value
INT_DS = -0AH ;INT DS register value
INT_FLGS = -0CH ;INT flags register value
INT_DI = -0EH ;INT DI register value (was -1EH, bug)
INT_SI = -10H ;INT SI register value
INT_BP = -12H ;INT BP register value
INT_DX = -14H ;INT DX register value
INT_CX = -16H ;INT CX register value
INT_BX = -18H ;INT BX register value
INT_AX = -1AH ;INT AX register value
OLD_SI = -1CH ;save old SI for interpreter
OLD_DI = -1EH ;save old DI for interpreter
FRM_SIZ = -1EH ;negative size of frame temporaries
; Locations past frame allocation used to recover post-INT BP value.
INT_BP_TMP = -22H ;temp location for INT BP register value
;***
; INTERRUPT, and INTERRUPTX - BASCOM software interrupt calling interface
;
; Purpose:
; To allow a BASIC Compiler program to perform any software
; interrupt. The interrupt is executed with the registers
; set to values specified in a register variable. The post-
; interrupt values of the registers are then stored in
; another register